import java.util.Scanner;

//题目：打印出如下图案（菱形）
public class Test19 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.print("请输入一个数:");
        int a = console.nextInt();
        print(a);
    }

    public static void print(int a) {
        for (int i = 0; i < a; i++) {//打印上半部分
            for (int j = 1; j < (a - i); j++) {
                System.out.print(" ");
            }
            for (int k = 0; k < (2 * i + 1); k++) {
                System.out.print("*");
            }
            System.out.println();
        }
        for (int i = a - 1; i > 0; i--) {//打印下半部分
            for (int j = a - i; j > 0; j--) {
                System.out.print(" ");
            }
            for (int k = 0; k < 2 * (i - 1) + 1; k++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
